/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Wasa;

/**
 *
 * @author gianmariospacagna
 */
public class Acceleration extends Response{
    private long time;

    public Acceleration(long time, double x, double y, double z) {
        this.time = time;
        this.x = x;
        this.y = y;
        this.z = z;
    }
    protected double x;
    protected double y;
    protected double z;
    
    
    

    
    
    
    
    public Acceleration(){
        super();
        this.x=0;
        this.y=0;
        this.z=0;
        this.time=System.currentTimeMillis();
        
    }

    public double getX() {
        return x;
    }

    public double getY() {
        return y;
    }

    public double getZ() {
        return z;
    }
    /**
     * Extract X Y Z values from the object
     * @param measure 
     */
    
    

    public long getTime() {
        return time;
    }
    
    
    public String toStringTXYZ(){
        return (String.valueOf(time) +","+String.valueOf(x)+","+String.valueOf(y)+","+String.valueOf(z));
    }
    
    public Acceleration normalize (Acceleration initAcc){
        this.x-=initAcc.getX();
        this.y-=initAcc.getY();
        this.z-=initAcc.getZ();
        
        return this;
    }
    
}
